package basic_1029;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scanner=new Scanner(System.in);
		
		String sell=scanner.next();
		String want=scanner.next();
		
		scanner.close();
		
		Map<Character, Integer> sellMap=new HashMap<Character, Integer>();
		Map<Character, Integer> wantMap=new HashMap<Character, Integer>();
		
		for(char c:sell.toCharArray()) {
			if(sellMap.containsKey(c)) {
				sellMap.put(c, sellMap.get(c)+1);
			}else {
				sellMap.put(c, 1);
			}
		}
		
		for(char c:want.toCharArray()) {
			if(wantMap.containsKey(c)) {
				wantMap.put(c, wantMap.get(c)+1);
			}else {
				wantMap.put(c, 1);
			}
		}
		
		int more=0;
		int less=0;
		for(char c :wantMap.keySet()) {
			if(!sellMap.containsKey(c)) {
				less+=wantMap.get(c);
			}else {
				int sn=sellMap.get(c);
				int wn=wantMap.get(c);
				if(sn<wn) {
					less+=wn-sn;
				}
			}
		}
		if(less==0) {
			more=sell.length()-want.length();
			System.out.println("YES "+more);
		}else {
			System.out.println("No "+less);
		}
	}
}
